<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建新课程 - 智能学习平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
    <style>
        .navbar {
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .form-container {
            max-width: 800px;
            margin: 2rem auto;
            background-color: #fff;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        .form-title {
            margin-bottom: 1.5rem;
            position: relative;
            padding-bottom: 0.5rem;
        }
        .form-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 60px;
            height: 3px;
            background-color: #007bff;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light bg-white">
        <div class="container">
            <a class="navbar-brand" href="/">
                <i class="fa fa-graduation-cap text-primary me-2"></i>
                智能学习平台
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="/">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/teacher/dashboard">教师中心</a>
                    </li>
                </ul>
                <div class="navbar-nav">
                    <span class="nav-item nav-link">欢迎，{{ user.name }}</span>
                    <a class="nav-link" href="/logout" onclick="event.preventDefault(); fetch('/logout').then(() => window.location.href='/')">
                        <i class="fa fa-sign-out me-1"></i>退出登录
                    </a>
                </div>
            </div>
        </div>
    </nav>

    <div class="container">
        <div class="form-container">
            <h2 class="form-title">创建新课程</h2>
            <form method="POST" action="/teacher/add_course">
                <div class="mb-3">
                    <label for="title" class="form-label">课程标题 <span class="text-danger">*</span></label>
                    <input type="text" class="form-control" id="title" name="title" required placeholder="请输入课程标题">
                </div>

                <div class="mb-3">
                    <label for="description" class="form-label">课程描述 <span class="text-danger">*</span></label>
                    <textarea class="form-control" id="description" name="description" rows="5" required placeholder="请详细描述课程内容、学习目标等"></textarea>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <label for="difficulty" class="form-label">难度级别 <span class="text-danger">*</span></label>
                        <select class="form-select" id="difficulty" name="difficulty" required>
                            <option value="">请选择难度</option>
                            <option value="初级">初级（适合零基础）</option>
                            <option value="中级">中级（有一定基础）</option>
                            <option value="高级">高级（专业人士）</option>
                        </select>
                    </div>

                    <div class="col-md-6">
                        <label for="tags" class="form-label">课程标签 <span class="text-danger">*</span></label>
                        <input type="text" class="form-control" id="tags" name="tags" required placeholder="请输入标签，用逗号分隔（例如：Python,编程,入门）">
                    </div>
                </div>

                <div class="d-flex justify-content-between">
                    <a href="/teacher/dashboard" class="btn btn-outline-secondary">取消</a>
                    <button type="submit" class="btn btn-primary">创建课程</button>
                </div>
            </form>
        </div>
    </div>

    <footer class="bg-dark text-white py-5 mt-8">
        <div class="container">
            <div class="row">
                <div class="col-md-4 mb-4">
                    <h5>关于我们</h5>
                    <p>智能学习平台致力于提供高质量的在线教育资源，助力每一位学习者成长。</p>
                </div>
                <div class="col-md-4 mb-4">
                    <h5>快速链接</h5>
                    <ul class="list-unstyled">
                        <li><a href="/" class="text-white">首页</a></li>
                        <li><a href="/login" class="text-white">登录</a></li>
                    </ul>
                </div>
                <div class="col-md-4">
                    <h5>联系我们</h5>
                    <p>邮箱: contact@example.com</p>
                </div>
            </div>
            <div class="border-top pt-3 mt-4 text-center">
                <p>&copy; 2025 智能学习平台 版权所有</p>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
